package org.example;

import org.example.registry.LocalRegistry;
import org.example.server.HttpServer;
import org.example.server.VertxHttpServer;
import org.example.service.UserService;
import org.example.service.impl.UserServiceImpl;

public class ProviderExample {
    public static void main(String[] args) {

        Thread.currentThread().setName("服务提供者");
        //RPC框架初始化
        RpcApplication.init();

        //注册服务
        LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);

        //启动web服务
        HttpServer httpServer = new VertxHttpServer();
        httpServer.doStart(RpcApplication.getRpcConfig().getServerPort());

    }
}
